home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 November
/
EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso
/
earcd
/
util
/
cli
/
0utils.lha
/
0Utils
/
Open.data
< prev
next >
Wrap
Text File
|
1995-08-19
|
1KB
|
73 lines
#ifdef TPLTER
Open = {
SHORT = {{ Open a filehandle }};
DESCRIPTION = {{
Openes an AmigaDOS Filehandle on a
certain file. the filehandle must be
closed with 'Close'.
Open is necessary for all filehandle
commands like ReadLn, WriteLn or
Close.
RESULT
The BPTR to the created Filehandle
}};
NOTES = {{
! Open is highly dangerous! Do not Use it, if !
! U do not exactly know what U are doing! !
}};
EXAMPLES = {{
> set fh `Open T:writetest WRITE`
> WriteLn $fh This is a test
> Close $fh
> Unset fh
> cat T:writetest
This is a test
}};
HISTORY = {{
21-02-95 b_noll created
21-02-95 b_noll added version/format-prefix/offset
20-03-95 b_noll corrected output
20-03-95 b_noll added args diagnostics
19-08-95 b_noll created .data file
}};
Template = "FILE/A,READ/S,WRITE/S";
Arguments = {{
STRPTR file;
ULONG read;
ULONG write;
}};
version = "1.1";
body = {{
{
ULONG mode = MODE_OLDFILE;
BPTR file;
if (argv->write)
mode = argv->read ? MODE_READWRITE : MODE_NEWFILE;
if (file = Open (argv->file, mode)) {
// MISSING: REGISTER(file);
FPrintf (Output(), "%ld\n", file);
retval = RETURN_OK;
} else {
retval = RETURN_ERROR;
} /* if */
}
}};
};
#endif